package net.whzjkj.gateway.model.vo;

import java.nio.charset.Charset;
import java.util.Arrays;

/**
 * 终端鉴权消息
 * 
 * @author hylexus
 *
 */
public class TerminalAuthenticationMessageVO extends PackageData {
	private String authCode;

	public TerminalAuthenticationMessageVO() {
	}

	public TerminalAuthenticationMessageVO(PackageData packageData) {
		this();
		this.channel = packageData.getChannel();
		this.checkCode = packageData.getCheckCode();
		this.messageBodyBytes = packageData.getMessageBodyBytes();
		this.messageHeader = packageData.getMessageHeader();
		this.authCode = new String(packageData.getMessageBodyBytes(),  Charset.forName("GBK"));
	}

	public void setAuthCode(String authCode) {
		this.authCode = authCode;
	}

	public String getAuthCode() {
		return authCode;
	}

	@Override
	public String toString() {
		return "TerminalAuthenticationMsg [authCode=" + authCode + ", msgHeader=" + messageHeader + ", msgBodyBytes="
				+ Arrays.toString(messageBodyBytes) + ", checkSum=" + checkCode + ", channel=" + channel + "]";
	}

}
